home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / bcc_src.lha / Parser / test / MyMet.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-28  |  2.4 KB  |  130 lines

  1. /* ---------------------------------------------- */
  2. /* BCC header. Inserted into every generated file */
  3. /* ---------------------------------------------- */
  4.  
  5. #ifndef _BCC_EVERY
  6. #define _BCC_EVERY
  7.  
  8. /* Includes necessary for every mui c code */
  9.  
  10. #include <proto/exec.h>
  11. #include <proto/muimaster.h>
  12. #include <libraries/mui.h>
  13.  
  14. #include <mui/muiextra.h>
  15.  
  16. #include <string.h>
  17.  
  18. /* defines that help adjusting to any compiler */
  19.  
  20. #ifdef _DCC
  21.     #define REG(x) __ ## x
  22.     #define ASM
  23.     #define SAVEDS __geta4
  24. #else
  25.     #define REG(x) register __ ## x
  26.  
  27.     #ifdef _STORM
  28.  
  29.             #define ASM
  30.             #define SAVEDS __saveds
  31.  
  32.     #else
  33.  
  34.         #if defined __MAXON__ || defined __GNUC__
  35.             #define ASM
  36.             #define SAVEDS
  37.         #else
  38.             #define ASM    __asm
  39.             #define SAVEDS __saveds
  40.         #endif
  41.     
  42.     #endif
  43.  
  44. #endif
  45.  
  46. #define CallSuper() DoSuperMethodA(cl, obj, msg)
  47. #define value (tag->ti_Data)
  48. #define GetData() INST_DATA(cl, obj)
  49.  
  50. #endif
  51. #include "MyClass.h"
  52. #include <proto/graphics.h>
  53.  
  54. unsigned long mMyClassMyMet( struct IClass *cl, Object *obj, Msg msg )
  55. {
  56.  MyClassData *data = INST_DATA( cl, obj );
  57.  /* UC Beg */
  58.  
  59.  
  60.     short a = 0;
  61.     a += 1;
  62.  
  63.  
  64.  /* UC End */
  65. return DoSuperMethodA( cl, obj, (Msg)msg );
  66. }
  67.  
  68. unsigned long mMyClassMUIM_AskMinMax( struct IClass *cl, Object *obj, struct MUIP_AskMinMax* msg )
  69. {
  70.  MyClassData *data = INST_DATA( cl, obj );
  71.  DoSuperMethodA( cl, obj, (Msg)msg );
  72.  /* UC Beg */
  73.  
  74.     msg->MinMaxInfo->MinWidth  += 100;
  75.     msg->MinMaxInfo->DefWidth  += 120;
  76.     msg->MinMaxInfo->MaxWidth  += MBQ_MUI_MAXMAX;
  77.  
  78.     msg->MinMaxInfo->MinHeight += 40;
  79.     msg->MinMaxInfo->DefHeight += 90;
  80.     msg->MinMaxInfo->MaxHeight += MBQ_MUI_MAXMAX;
  81.  
  82.  
  83.  /* UC End */
  84.  
  85.  return 0;
  86. }
  87.  
  88. unsigned long mMyClassMUIM_Draw( struct IClass *cl, Object *obj, struct MUIP_Draw* msg )
  89. {
  90.  MyClassData *data = INST_DATA( cl, obj );
  91.  DoSuperMethodA( cl, obj, (Msg)msg );
  92.  /* UC Beg */
  93.  
  94.  
  95.     if ( msg->flags & MADF_DRAWOBJECT ) {
  96.  
  97.         SetAPen( _rp( obj ), 1 );
  98.         Move( _rp( obj ), _mleft( obj ), _mtop( obj ) );
  99.         Draw( _rp( obj ), _mright( obj ), _mbottom( obj ) );
  100.  
  101.     }
  102.     
  103.  
  104.  /* UC End */
  105.  
  106.  return 0;
  107. }
  108.  
  109. unsigned long mMyClassOM_NEW( struct IClass *cl, Object *obj, Msg msg )
  110. {
  111.  MyClassData *data, _tdata;
  112.  data = &_tdata;
  113.  obj = (Object*)DoSuperNew( cl, obj,
  114.  
  115.         MUIA_Frame, MUIV_Frame_Button
  116. ,
  117.  TAG_MORE, (unsigned long)msg->ops_AttrList,
  118.  TAG_DONE );
  119.  if( !obj ) return 0;
  120.  data = INST_DATA( cl, obj );
  121.  memcpy( data, &_tdata, sizeof( MyClassData ) );
  122.  /* UC Beg */
  123.  
  124.  
  125.  
  126.  /* UC End */
  127.  
  128.  return (unsigned long)obj;
  129. }
  130.